package com.human.controller;


import com.human.entity.Dept;
import com.human.entity.ResultVo;
import com.human.service.IDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门 前端控制器
 * </p>
 *
 * @author jzq
 * @since 2023-02-28
 */
@RestController
@RequestMapping("/api/dept")
@Api(tags = "部门管理")
public class DeptController {

    @Autowired
    IDeptService deptService;

    @GetMapping("/deptList")
    @ApiOperation(value = "查询所有部门")
    public ResultVo<Dept> getAllDept() {
        return deptService.getAllDept();
    }

    @GetMapping("/getDeptAndPos")
    @ApiOperation(value = "查询所有部门与职位")
    public ResultVo<List> getDeptAndPos() {
        return deptService.getDeptAndPos();
    }

    @GetMapping("/getNum")
    @ApiOperation(value = "查询各部门总人数")
    public ResultVo getDeptPersonNum() {
        return deptService.getDeptPersonNum();
    }

}

